<%@ page import="com.actimind.actitime.beans.UserBean,
                 com.actimind.actitime.Keys"%><%@ page errorPage="/error.jsp" %><%

UserBean user = (UserBean)session.getAttribute(Keys.LOGGEDIN_USER_KEY);
if (user != null)
{
%>
<%@ taglib uri="/WEB-INF/at.tld" prefix="at" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<head>
    <title><bean:write name="title-prefix" scope="application"/> Modify My Profile</title>

    <link rel="stylesheet" href="css/at.css" type="text/css">

    <script language="JavaScript" src="js/at.js"></script>
    <script language="JavaScript">
    function doSubmit(f)
    {
        /*if (!checkField(f.firstName, "First name is empty", "isNotEmpty"))
            return false;

        if (!checkField(f.lastName, "Last name is empty", "isNotEmpty"))
            return false;

        if (isNotEmpty(f.email.value) &&
            !checkField(f.email, "Please specify a valid email address", "isEmailValid"))
            return false;

        trimAllTextFields(f);
        normalizeAllTextFields(f);*/

        return true;
    }
    </script>
</head>

<body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">

<jsp:include page="top.jsp" flush="false">
    <jsp:param name="pageSection" value="profile" />
    <jsp:param name="pageAction" value="" />
</jsp:include>

<html:form scope="session" action="profile.do" method="post" onsubmit="return doSubmit(this)">

<input type="hidden" name="submitted" value="1" />

<table cellspacing="0" cellpadding="5" align="center" valign="top" border="0" bgcolor="#ffffff" width="770">
<tr>
    <td class="pagetitle">
        Modify My Profile
    </td>
</tr>
<tr>
    <td class="pagetitle">
        <at:errors />
        <at:messages id="message" message="true">
            <span class="successmsg"><bean:write name="message"/></span>
        </at:messages>
    </td>
</tr>
<tr>
    <td>
        <table cellspacing="0" cellpadding="0" align="left" valign="top" border="0" bgcolor="#ffffff">
        <tr>
            <td colspan="4" class="formdesc">
                Edit any or all of the information below, then click "Save Changes" button.
            </td>
        </tr>
        <tr>
            <td colspan="4"><img height="10" width="1" src="img/pixel.gif"></td>
        </tr>
        <tr>
            <td height="5" colspan="4" class="formcomment" nowrap=1><nobr><span class="formfieldtitlereq">*</span>&nbsp;Indicates a required field.</nobr></td>
        </tr>
        <tr>
            <td colspan="4"><img height="10" width="1" src="img/pixel.gif"></td>
        </tr>
        <tr>
            <td colspan="4" class="formblocktitle">
                Change Password
            </td>
        </tr>
        <tr>
            <td colspan="4"><img height="10" width="1" src="img/pixel.gif"></td>
        </tr>
        <tr>
            <td>
                <img height="1" width="20" src="img/pixel.gif">
            </td>
            <td>
                <table cellspacing="0" cellpadding="3" align="left" valign="top" border="0" bgcolor="#ffffff">
                <tr>
                    <td class="formfieldtitlereq">
                        &nbsp;
                    </td>
                    <td class="formfieldtitle">
                        <logic:messagesPresent property="passwords"><span class="errormsg">Current Password:</span></logic:messagesPresent>
                        <logic:messagesNotPresent property="passwords">Current Password:</logic:messagesNotPresent>
                    </td>
                    <td>
                        <html:password property="passwordCur" style="width: 203px" />
                    </td>
                </tr>
                <tr>
                    <td class="formfieldtitlereq">
                        &nbsp;
                    </td>
                    <td class="formfieldtitle">
                        <logic:messagesPresent property="passwords"><span class="errormsg">New Password:</span></logic:messagesPresent>
                        <logic:messagesNotPresent property="passwords">New Password:</logic:messagesNotPresent>
                    </td>
                    <td>
                        <html:password property="passwordNew" style="width: 203px" />
                    </td>
                </tr>
                <tr>
                    <td class="formfieldtitlereq">
                        &nbsp;
                    </td>
                    <td class="formfieldtitle">
                        <logic:messagesPresent property="passwords"><span class="errormsg">Retype Password:</span></logic:messagesPresent>
                        <logic:messagesNotPresent property="passwords">Retype Password:</logic:messagesNotPresent>
                    </td>
                    <td>
                        <html:password property="passwordRetype" style="width: 203px" />
                    </td>
                </tr>
                </table>
            </td>
            <td>
                <img height="1" width="20" src="img/pixel.gif">
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td colspan="4"><img height="10" width="1" src="img/pixel.gif"></td>
        </tr>
        <tr>
            <td colspan="4" class="formblocktitle">
                Update Personal Information:
            </td>
        </tr>
        <tr>
            <td colspan="4"><img height="10" width="1" src="img/pixel.gif"></td>
        </tr>
        <tr>
            <td>
                <img height="1" width="20" src="img/pixel.gif">
            </td>
            <td>
                <table cellspacing="0" cellpadding="3" align="left" valign="top" border="0" bgcolor="#ffffff">
                <tr>
                    <td class="formfieldtitlereq">
                        *
                    </td>
                    <td class="formfieldtitle">
                        <logic:messagesPresent property="firstName"><span class="errormsg">First Name:</span></logic:messagesPresent>
                        <logic:messagesNotPresent property="firstName">First Name:</logic:messagesNotPresent>
                    </td>
                    <td>
                        <html:text property="firstName" style="width: 203px" />
                    </td>
                </tr>
                <tr>
                    <td class="formfieldtitlereq">
                        *
                    </td>
                    <td class="formfieldtitle">
                        <logic:messagesPresent property="lastName"><span class="errormsg">Last Name:</span></logic:messagesPresent>
                        <logic:messagesNotPresent property="lastName">Last Name:</logic:messagesNotPresent>
                    </td>
                    <td>
                        <html:text property="lastName" style="width: 203px" />
                    </td>
                </tr>
                <tr>
                    <td class="formfieldtitlereq">
                        &nbsp;
                    </td>
                    <td class="formfieldtitle">
                        <logic:messagesPresent property="middleName"><span class="errormsg">Middle Initial:</span></logic:messagesPresent>
                        <logic:messagesNotPresent property="middleName">Middle Initial:</logic:messagesNotPresent>
                    </td>
                    <td>
                        <html:text property="middleName" style="width: 50px" />
                    </td>
                </tr>
                <tr>
                    <td class="formfieldtitlereq">
                        &nbsp;
                    </td>
                    <td class="formfieldtitle">
                        <logic:messagesPresent property="email"><span class="errormsg">E-mail Address:</span></logic:messagesPresent>
                        <logic:messagesNotPresent property="email">E-mail Address:</logic:messagesNotPresent>
                    </td>
                    <td>
                        <html:text property="email" style="width: 203px" />
                    </td>
                </tr>
                </table>
            </td>
            <td>
                <img height="1" width="20" src="img/pixel.gif">
            </td>
            <td>
                <table cellspacing="0" cellpadding="3" align="left" valign="top" border="0" bgcolor="#ffffff">
                <tr>
                    <td class="formfieldtitlereq">
                        &nbsp;
                    </td>
                    <td class="formfieldtitle">
                        <logic:messagesPresent property="phone"><span class="errormsg">Phone:</span></logic:messagesPresent>
                        <logic:messagesNotPresent property="phone">Phone:</logic:messagesNotPresent>
                    </td>
                    <td>
                        <html:text property="phone" style="width: 203px" />
                    </td>
                </tr>
                <tr>
                    <td class="formfieldtitlereq">
                        &nbsp;
                    </td>
                    <td class="formfieldtitle">
                        <logic:messagesPresent property="fax"><span class="errormsg">Fax:</span></logic:messagesPresent>
                        <logic:messagesNotPresent property="fax">Fax:</logic:messagesNotPresent>
                    </td>
                    <td>
                        <html:text property="fax" style="width: 203px" />
                    </td>
                </tr>
                <tr>
                    <td class="formfieldtitlereq">
                        &nbsp;
                    </td>
                    <td class="formfieldtitle">
                        <logic:messagesPresent property="mobile"><span class="errormsg">Mobile:</span></logic:messagesPresent>
                        <logic:messagesNotPresent property="mobile">Mobile:</logic:messagesNotPresent>
                    </td>
                    <td>
                        <html:text property="mobile" style="width: 203px" />
                    </td>
                </tr>
                <tr>
                    <td class="formfieldtitlereq">
                        &nbsp;
                    </td>
                    <td class="formfieldtitle">
                        <logic:messagesPresent property="otherContact"><span class="errormsg">Other Contact #:</span></logic:messagesPresent>
                        <logic:messagesNotPresent property="otherContact">Other Contact #:</logic:messagesNotPresent>
                    </td>
                    <td>
                        <html:text property="otherContact" style="width: 203px" />
                    </td>
                </tr>
                </table>
            </td>
        </tr>
        </table>
    </td>
</tr>
<tr>
    <td align="center" class="formbuttonpane">
        <input type="submit" value="Save Changes" />
    </td>
</tr>
</table>

</html:form>

</body>
</html>
<%
}
else
{
    response.sendRedirect("login.do");
}
%>